package initialize

import (
	"github.com/gin-gonic/gin"
	"mxshop_api/user-web/middlewares"
	"mxshop_api/user-web/router"
	"net/http"
)

func Routers() *gin.Engine {

	r := gin.Default()
	r.Use(middlewares.Cors())
	r.GET("/", func(context *gin.Context) {
		context.JSON(http.StatusOK, gin.H{})
	})
	routerGroup := r.Group("/v1")
	router.InitUserRouter(routerGroup)
	router.InitBaseRouter(routerGroup)
	return r
}
